﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Tradex.Market;
using Tradex.Trading;

namespace Tradex.Messages {
    
    /// <summary>
    /// An InstrumentActivityUpdate contains information about an instrument's trading avtivity. These are the so called "Ticks"
    /// from other similar packages. They also include market mode changes when available.
    /// </summary>
    [Serializable()]
    public class InstrumentActivityUpdateMessage : Message {

        /// <summary>
        /// Constructo rtaking all values.
        /// </summary>
        /// <param name="instrumentKey"></param>
        /// <param name="activity"></param>
        public InstrumentActivityUpdateMessage(InstrumentKey instrumentKey, MarketUpdate activity) {
            InstrumentKey = instrumentKey;
            Activity = activity;
        }

        /// <inheritdoc />
        public override MessageCode Code { get { return MessageCode.InstrumentActivityUpdate; } }

        /// <summary>
        /// This key describes the instrument the activity update is for.
        /// </summary>
        public InstrumentKey InstrumentKey { get; private set; }

        /// <summary>
        /// This key describes the feed the update is coming from.
        /// </summary>
        public FeedKey FeedKey { get; private set; }

        /// <summary>
        /// This update describes the request code. There are three possible values here:
        /// * A null describes a value that is not part of a determined data request (for historical
        /// data), but real data from the live feed.
        /// * An empty string days that this is feed data, but delivered out of time / repeated.
        /// * A non-empty string can be used to determine the request for which this data is reported.
        /// </summary>
        public string RequestCode { get; private set; }

        /// <summary>
        /// The activity
        /// </summary>
        public MarketUpdate Activity { get; private set; }

    }
}
